:root {
    --primary-color: #007AFF;
    --secondary-color: #34C759;
    --background-color: rgba(242, 242, 247, 0.8);
    --text-color: #000000;
    --border-color: #E5E5EA;
    --toolbar-height: 48px;
    --toc-width: 25%;
    --toc-header-height: 48px;
    --toc-collapsed-width: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
} */

.ps-container {
    width: 780px;
    height: 590px;
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

/* 工具栏样式 */
.ps-toolbar {
    height: var(--toolbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
}

.ps-left-tools, .ps-right-tools {
    display: flex;
    gap: 8px;
}

.ps-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ps-button.ps-active {
    background: var(--primary-color);
    color: white;
}

.ps-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* 主体内容样式 */
.ps-main-content {
    flex: 1;
    display: flex;
    position: relative;
    background: white;
    overflow: hidden;
}

/* 目录面板样式 */
.ps-toc-panel {
    width: var(--toc-width);
    min-width: var(--toc-width);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.ps-toc-panel.ps-collapsed {
    min-width: var(--toc-collapsed-width);
    width: var(--toc-collapsed-width);
}

.ps-toc-header {
    height: var(--toc-header-height);
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
}

.ps-toc-panel.ps-collapsed .ps-toc-header {
    padding: 0 4px;
    justify-content: center;
}

.ps-toc-panel.ps-collapsed .ps-toc-header h3 {
    display: none;
}

.ps-toggle-btn {
    padding: 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.ps-arrow {
    font-size: 16px;
    line-height: 1;
    color: var(--text-color);
    display: block;
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.ps-toc-panel.ps-collapsed .ps-arrow {
    transform: rotate(0deg);
}

.ps-toc-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.ps-toc-panel.ps-collapsed .ps-toc-content {
    display: none;
}

.ps-toc-item {
    margin-bottom: 8px;
}

.ps-toc-item a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ps-toc-item a:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

/* Markdown内容区域样式 */
.ps-markdown-content {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
    line-height: 1.6;
    font-size: 14px;
    max-width: calc(100% - var(--toc-width));
}

.ps-toc-panel.ps-collapsed + .ps-markdown-content {
    max-width: calc(100% - var(--toc-collapsed-width));
}

.ps-markdown-content h1,
.ps-markdown-content h2,
.ps-markdown-content h3,
.ps-markdown-content h4,
.ps-markdown-content h5,
.ps-markdown-content h6 {
    margin: 1.5em 0 0.8em;
    color: #333;
}

.ps-markdown-content h1 {
    font-size: 2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.ps-markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.ps-markdown-content p {
    margin: 1em 0;
    line-height: 1.8;
}

.ps-markdown-content code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.ps-markdown-content pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 1em 0;
    white-space: pre;
    word-wrap: normal;
}

.ps-markdown-content pre code {
    display: inline-block;
    min-width: 100%;
}

.ps-markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.ps-markdown-content a:hover {
    text-decoration: underline;
}

.ps-markdown-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 4px;
}

.ps-markdown-content blockquote {
    margin: 1em 0;
    padding: 0 1em;
    color: #666;
    border-left: 0.25em solid #dfe2e5;
}

.ps-markdown-content ul,
.ps-markdown-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.ps-markdown-content li {
    margin: 0.5em 0;
}

.ps-markdown-content table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    white-space: nowrap;
}

.ps-markdown-content table th,
.ps-markdown-content table td {
    border: 1px solid #dfe2e5;
    padding: 8px 12px;
}

.ps-markdown-content table th {
    background-color: #f6f8fa;
    font-weight: 600;
}

.ps-markdown-content table tr:nth-child(2n) {
    background-color: #f8f9fa;
}

/* 滚动条样式 */
.ps-toc-content::-webkit-scrollbar,
.ps-markdown-content::-webkit-scrollbar {
    width: 8px;
}

.ps-toc-content::-webkit-scrollbar-track,
.ps-markdown-content::-webkit-scrollbar-track {
    background: transparent;
}

.ps-toc-content::-webkit-scrollbar-thumb,
.ps-markdown-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.ps-toc-content::-webkit-scrollbar-thumb:hover,
.ps-markdown-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 状态样式 */
.ps-success {
    background-color: var(--secondary-color) !important;
    color: white !important;
}

.ps-error {
    color: #ff3b30;
    padding: 16px;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* 源码编辑器样式 */
.ps-source-editor {
    width: 100%;
    height: 100%;
    padding: 16px;
    border: none;
    resize: none;
    background: #f8f9fa;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    outline: none;
}

.ps-source-editor:focus {
    background: #fff;
}

/* 渲染内容区域 */
.ps-render-content {
    height: 100%;
    overflow-y: auto;
}

/* 对话框样式 */
.ps-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ps-dialog-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    width: 400px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.ps-dialog h2 {
    margin: 0 0 20px;
    font-size: 18px;
    color: var(--text-color);
}

.ps-form-group {
    margin-bottom: 16px;
}

.ps-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.ps-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    transition: border-color 0.2s ease;
}

.ps-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.ps-dialog-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ps-button.ps-primary {
    background: var(--primary-color);
    color: white;
}

.ps-button.ps-primary:hover {
    background: #0056b3;
}

/* 目录列表样式 */
.ps-directory-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.ps-directory-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-directory-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ps-directory-item.selected {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.ps-directory-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
} 